﻿<%@ Page Language="C#" MasterPageFile="~/Template.master" AutoEventWireup="true"
    CodeFile="Goods.aspx.cs" Inherits="GoodsPage" Title="Ghasam Co. Goods" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="title">
        <span class="pageTitle">کالا</span>
        <hr />
    </div>
    <div>
        <mani:PagingGridView ID="gvGoods" runat="server" AllowPaging="True"
            VirtualItemCount="-1" PageSize="15" DataKeyNames="ID" AutoGenerateColumns="false" OnPageIndexChanging="gvGoods_PageIndexChanging" OnSelectedIndexChanging="gvGoods_SelectedIndexChanging" OnRowDeleting="gvGoods_RowDeleting">
            <Columns>
                <asp:BoundField DataField="Id" HeaderText="شناسه" Visible="false" />
                <asp:BoundField DataField="Name" HeaderText="نام کالا" />
                <asp:TemplateField HeaderText="قیمت واحد">
                    <ItemTemplate>
                        <%# Mani.Common.UIHelper.FormatString(Eval("UnitPrice")) %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CheckBoxField DataField="IsDiscountable" HeaderText="تخفیف دار" />
                <asp:TemplateField InsertVisible="False" HeaderText="زمان ایجاد">
                    <ItemTemplate>
                        <%# Mani.Common.MyPersianDate.DateTimeToPersian(Eval("CreateDate"))  %>
                    </ItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="EditGoods" runat="server" CausesValidation="False" CommandName="Select">
                                <img src="App_Themes/<%=Page.Theme %>/images/edit.gif" alt="" style="border:0;" />
                        </asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="DeleteGoods" runat="server" CausesValidation="False" CommandName="Delete">
                                <img src="App_Themes/<%=Page.Theme %>/images/delete.gif" alt="" style="border:0;" />
                        </asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                
            </Columns>
        </mani:PagingGridView>
    </div>
    
    <div id="formcontainer">
        <div>
            <label>کد کالا</label>
            <asp:TextBox ID="txtGoodsId" ReadOnly="true" runat="server" />
        </div>
        <div>
            <label>نام کالا</label>
            <asp:TextBox ID="txtGoodsName" runat="server" />
            <asp:RequiredFieldValidator ID="rfvGoodsName" runat="server" ControlToValidate="txtGoodsName" ErrorMessage="*" />
        </div>
        <div>
            <label>قیمت واحد</label>
            <asp:TextBox ID="txtUnitPrice" runat="server" />
            <asp:RequiredFieldValidator ID="rfvUnitPriceIns" runat="server" ControlToValidate="txtUnitPrice" ErrorMessage="*" />
        </div>
        <div>
            <label>قابل تخفیف</label>
            <asp:CheckBox ID="cbIsDiscountable" runat="server" />
        </div>
        <div>
            <label>زمان ایجاد</label>
            <asp:TextBox ID="txtCreateDate" ReadOnly="true" runat="server" />
        </div>
        <div>
            <button id="btnSave" runat="server" style="height: 20px; font-family: Tahoma; font-size: 11px;"
                type="button" onserverclick="btnSave_ServerClick">
                ذخیره</button>
            <button id="btnClear" runat="server" style="height: 20px; font-family: Tahoma; font-size: 11px;"
                type="button" onserverclick="btnClear_ServerClick">انصراف</button>
        </div>
    </div>
</asp:Content>
